<template>
  <h2>这是子组件{{ title }}</h2>
  <button @click="biubiu">向父组件通信</button>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      required: true,
    },
  },
  setup(props, { emit }) {
    const biubiu = () => {
      emit("piapia", "这是子组件中的数据");
    };
    return {
      biubiu,
    };
  },
};
</script>

<style lang="scss" scoped></style>
